<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateSpotTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateSpotLabel_sid}" for="sid" />
                    <h:inputText id="sid" value="#{spotController.selected.sid}" title="#{bundle.CreateSpotTitle_sid}" required="true" requiredMessage="#{bundle.CreateSpotRequiredMessage_sid}"/>
                    <h:outputLabel value="#{bundle.CreateSpotLabel_name}" for="name" />
                    <h:inputText id="name" value="#{spotController.selected.name}" title="#{bundle.CreateSpotTitle_name}" required="true" requiredMessage="#{bundle.CreateSpotRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.CreateSpotLabel_pic}" for="pic" />
                    <h:inputText id="pic" value="#{spotController.selected.pic}" title="#{bundle.CreateSpotTitle_pic}" />
                    <h:outputLabel value="#{bundle.CreateSpotLabel_rid}" for="rid" />
                    <h:selectOneMenu id="rid" value="#{spotController.selected.rid}" title="#{bundle.CreateSpotTitle_rid}" required="true" requiredMessage="#{bundle.CreateSpotRequiredMessage_rid}">
                        <f:selectItems value="#{restaurantController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateSpotLabel_username}" for="username" />
                    <h:selectOneMenu id="username" value="#{spotController.selected.username}" title="#{bundle.CreateSpotTitle_username}" required="true" requiredMessage="#{bundle.CreateSpotRequiredMessage_username}">
                        <f:selectItems value="#{userController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{spotController.create}" value="#{bundle.CreateSpotSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{spotController.prepareList}" value="#{bundle.CreateSpotShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateSpotIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
